package com.maotai.bl.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component("blDao")
@Transactional
public class BLDao extends CommonDao{
	
	public int insertZhanghaoWeb(Map<String, String> map)throws SQLException{
		Map<String, Object> yuyueitemOne = this.getSqlSession().selectOne("com.maotai.bl.dao.BLMapper.getZhanghaoOne",map);
		if(yuyueitemOne!=null) return 1;
		else
		return this.getSqlSession().insert("com.maotai.bl.dao.BLMapper.insertZhanghaoWeb",map);
	}
	public Map<String, Object> getShenFengRandom()throws SQLException{
		Map<String, Object> map = this.getSqlSession().selectOne("com.maotai.bl.dao.BLMapper.getShenFengRandom");
		this.getSqlSession().update("com.maotai.bl.dao.BLMapper.updateShenFeng",map);
		return map;
    } 
}
